package com.example.librarymanagementsystembackend.utils;

public class ResponseDataUtils {

    /**
     * 成功响应，带数据
     */
    public static ResponseData success(Object data) {
        return new ResponseData(200, "成功", data);
    }

    /**
     * 成功响应，无数据
     */
    public static ResponseData success() {
        return new ResponseData(200, "成功", null);
    }

    /**
     * 成功响应，自定义消息和数据
     */
    public static ResponseData success(String message, Object data) {
        return new ResponseData(200, message, data);
    }

    /**
     * 错误响应
     */
    public static ResponseData error(int code, String message) {
        return new ResponseData(code, message, null);
    }
}